from loguru import logger


def get_logger(filename):
    # 添加日志文件
    logger.add(sink=filename, encoding="utf-8"
               # # level="ERROR",
               # rotation="100 MB"  # 10 M  100 M
               )
    return logger


if __name__ == '__main__':
    log = get_logger("../logs/huile.log")
    log.info("欢迎。。。")
    log.warning("欢迎。来到慧乐。。")
